<template>
  <div id="app">
    <div class="menu-header">
      <!-- <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> |
      <router-link to="/mine">Demo</router-link> |
      <router-link to="/login">login</router-link> -->
      <template v-for="(item) in routes" :key="item.path">
        <router-link  :to="item.path">{{ item.name }}</router-link> |
      </template>
      
    </div>
    <div class="view-content">
      <!-- 路由视图，用于显示当前路由的组件 -->
      <router-view></router-view>
    </div>
  </div>
</template>
<script>

import router from './router/index.js'

export default {
  name: 'App',
  // data:{
  //   routes:[]
  // },
  computed:{
    routes(){
      return router.options.routes
    }
  },
  mounted(){
    console.log('app')
    // console.log('router:',router.options.routes)
    // console.log(this.routes)
    // this.routes=router.options.routes
    console.log(this.routes)
  }
};
</script>
<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
  color: #2c3e50;
  width:100%;
  display: flex;
  flex-direction: column;
  
}
</style>
